/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package gui.event.khachhang;

import control.khachhang.KHSuaThongTin_Full_Ctrl;
import gui.khachhang.KHSuaThongTin_Dialog;
import javax.swing.JDialog;
import javax.swing.JOptionPane;
import javax.swing.JTable;
import model.entity.KhachHang;

/**
 *
 * @author nv_ca@live.com
 */
public class KHSuaThongTinFull_evt {
    
    public static final void btnLietKeActionPerformed() {
        //TODO tổng hợp điều kiện và liệt kê
//        JOptionPane.showMessageDialog(null, "Filter");
    }
    
    public static final void btnSuaActionPerformed(JTable table) {
        KhachHang kh = KHSuaThongTin_Full_Ctrl.selectRow(table);
         //TODO load thông tin khách hàng được chọn qua khSuaDlg
        KHSuaThongTin_Dialog khSuaDlg = new KHSuaThongTin_Dialog(table, null, true);
        khSuaDlg.getTxtMaKH().setText(""+kh.getKhMa());
        khSuaDlg.getTxtHo().setText(""+kh.getKhHo());
        khSuaDlg.getTxtTen().setText(""+kh.getKhTen());
        
        khSuaDlg.getTxtSoDT().setText(""+kh.getKhSdt());
        khSuaDlg.getjDateChooser1().setDate(kh.getKhNgaySinh());
        khSuaDlg.getTxtDiaChi().setText(""+kh.getKhDiaChi());
        khSuaDlg.getTaGhiChu().setText(""+kh.getKhGhiChu());
        khSuaDlg.setLocationRelativeTo(null);
        khSuaDlg.setVisible(true);
    }
    
    public static final void btnDongActionPerformed(JDialog dlg) {
        dlg.dispose();
    }

    public static void btnSuaActionPerformed() {
        throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
    }
    
}
